# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Evgeniy Alekseev <arcanis at archlinux dot org>
# Contributor: Julien Nicoulaud <julien.nicoulaud at gmail dot com>

pkgname=zsh-completions
pkgver=0.34.0
pkgrel=4
pkgdesc="Additional completion definitions for Zsh"
arch=(any)
url="https://github.com/zsh-users/zsh-completions"
license=(BSD)
depends=(zsh)
source=($pkgname-$pkgver.tar.gz::https://github.com/zsh-users/$pkgname/archive/refs/tags/$pkgver.tar.gz)
sha512sums=('643e967a77ab708c6316a9b43edd8b411f133aa4abe10bf69d3f5e545b2128423ad80d3509e7f9077b30cb8a83f60fe8d4355ed0a697dadffe1e1aaac6597c04')
b2sums=('75afed3059e889f92843099ad3eddae1f939a7d9a46d87a8048c5742b44699c2da13a9c2ea00ca2ea02898472199f064c420aac8943338e3b22189a7cc0d23b4')
changelog=ChangeLog

package() {
  local completion
  local provided_completions=(
    _tmuxp
    _trash
    _trash-empty
    _trash-list
    _trash-put
    _trash-restore
    _vagrant
  )

  cd $pkgname-$pkgver
  install -vDm 644 src/* -t "$pkgdir/usr/share/zsh/site-functions/"
  install -vDm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
  install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"

  # remove completions which are provided by other packages
  for completion in "${provided_completions[@]}"; do
    rm -v "$pkgdir/usr/share/zsh/site-functions/$completion"
  done
}

# vim:set ts=2 sw=2 et:
